<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/styles/regist.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-form/jquery.form.js"></script>

    <script type="text/javascript" src="/js/plugins/jquery-validation/additional-methods.min.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-validation/jquery.validate.min.js"></script>

    <script type="text/javascript" src="/js/system/common.js"></script>
   <!-- <script>
        $(function () {
            $( "#editForm" ).validate({
                rules: {
                    nickname: {
                        required: true,
                        minlength: 2,
                        maxlength: 10
                    },
                    password: "required",
                    rpassword: {
                        required: "确认密码不能为空",
                        equalTo: "确认密码与密码不一致"
                    }
                }
            });
        });
    </script>-->
    <script>
        $(function () {
            $(function () {
                //短信发送
                $('.vcode-send').click(function () {
                    if ($(this).hasClass('disabled')) {
                    } else {
                        var self = $(this);
                        var count = 10;
                        self.addClass('disabled')
                        self.text(count + '秒后重新获取')
                        var timer = setInterval(function () {
                            count--;
                            if (count > 0) {
                                self.text(count + '秒后重新获取');
                            } else {
                                clearInterval(timer)
                                self.text('重新获取验证码')
                                self.removeClass("disabled");
                            }
                        }, 1000);
                        var phone = $("#phone").val();
                        $.get("/sendVerifyCode", {phone:phone}, function (data) {

                            console.log(data);
                            if(data.success){
                                popup("发送成功")
                            }else{
                                popup(data.msg);
                            }
                        })
                    }
                });

                //注册
                $("#editForm").ajaxForm(function (data) {
                    if(data.success){
                        location.href = "/login.html";
                    }else{
                        popup(data.msg);
                    }
                })
            });
        })
    </script>
</head>
<body>
<div class="wrapper">
    <div class="container container-login">
        <a href="javascript:;" title="返回首页" class="logo">骡窝窝</a>
        </div>
    <div class="add-info">
        <div class="hd">修改密码</div>
        <form action="/mine/setPassword" method="post" id="editForm">
            <input type="hidden" name="phone" value="${phone}" id="phone">
            <div class="form-field">
                <input name="password" type="password" placeholder="旧密码">
                <div class="err-tip"></div>
            </div>
            <div class="form-field">
                <input name="rpassword" type="password" placeholder="新密码" >
                <div class="err-tip"></div>
            </div>

            <div class="form-field">
                <div class="clearfix">
                    <a href="#" class="vcode-send sms-code-send">获取验证码</a>
                    <input name="verifyCode" type="text" placeholder="短信验证码" autocomplete="off"class="vcode-input">
                </div>
                <div class="err-tip clearfix"></div>
            </div>
            <div class="submit-btn">
                <button type="submit">完成修改</button>
            </div>
        </form>
    </div>
    </div>
</div>
<div class="fullscreen-bg"
     style="background-image: url(https://images.mafengwo.net/images/signup/wallpaper/27.jpg);">
    <img src="/27.jpg" style="width: auto; height: 657px; margin-top: -213px;">
</div>
</body>
</html>